cat - | sort -t'	' -k2,2r -T ./ | awk '
    BEGIN { FS="\t"; OFS="\t"; }
    {
        if ($2=="B") d[$1]=1;
        if ($2=="A")
        {
            if (!($1 in d))
            {
                line = "";
                for (i = 3; i <= NF; i++)
                {
                    if (line != "")
                        line = line "\t"
                    line = line $i;
                }
                print line;
            }
        }
    }
'
